package com.shunbo.convenient.service.impl;

import com.github.pagehelper.Page;
import com.shunbo.convenient.dao.ProductMapper;
import com.shunbo.convenient.service.ProductService;
import com.shunbo.convenient.vo.Product;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author weizhuang
 */

@Service
@Transactional
public class ProductServiceImpl implements ProductService{

    @Resource
    private ProductMapper productMapper;

    @Override
    public Integer save(Product obj) {
        return productMapper.save(obj);
    }

    @Override
    public Integer update(Product obj) {
        return productMapper.update(obj);
    }

    @Override
    public Integer delete(String obj) {
        return productMapper.delete(obj);
    }

    @Override
    public Product findById(String obj) {
        return productMapper.findById(obj);
    }

    @Override
    public List<Product> findAll(Product obj) {
        return productMapper.findAll(obj);
    }

    @Override
    public Page<Product> findByIds(List<String> ids) {
        return productMapper.findByIds(ids);
    }

    @Override
    public Page<Product> findByName(Product product) {
        return productMapper.findByName(product);
    }
}
